import { PageData, PutDto, PutRes, DisableDto, DisableRes } from "~/rest";
import { Gateway, getGateway } from "@/droplet-bus/core.define";

import { app_gateway } from "./core.local";
import { Formula, Paster } from "./schema.default";

export const AssetDefaultGateway: Gateway = getGateway(app_gateway, "pond_asset_default");

export const PasterGateway: Gateway = getGateway(app_gateway, "pond_asset_paster");
export type putPasterDto = PutDto<Paster>;
export type disablePasterDto = DisableDto;

export interface PasterInterfaceWithDerive<T> {
  get(dto: T): Promise<PageData<Paster>>;
  put(dto: T & putPasterDto): Promise<PutRes<Paster>>;
  disable(dto: T & disablePasterDto): Promise<DisableRes>;
}

export const FormulaGateway: Gateway = getGateway(app_gateway, "pond_asset_formula");
export type putFormulaDto = PutDto<Formula>;
export type disableFormulaDto = DisableDto;

export interface FormulaInterfaceWithDerive<T> {
  get(dto: T): Promise<PageData<Formula>>;
  put(dto: T & putFormulaDto): Promise<PutRes<Formula>>;
  disable(dto: T & disableFormulaDto): Promise<DisableRes>;
}
